package api

import (
	"github.com/gin-gonic/gin"
	"github.com/swaggo/gin-swagger"
	"github.com/swaggo/gin-swagger/swaggerFiles"
)

func initSwagger(router *gin.Engine) {
	// swagger访问地址 http://localhost:8080/swagger/index.html
	url := ginSwagger.URL("http://localhost:8080/swagger/doc.json") // The url pointing to API definition
	// 添加swagger的路由  不然报错404 page not found
	router.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler, url))
}
